<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="/layui-v2.7.2/layui/css/layui.css">
  <script src="/layui-v2.7.2/layui/layui.js"></script>
</head>

<body>
  <form class="layui-form" action="/login" method="post">
    <div class="layui-form-item">
      <label class="layui-form-label">用户名</label>
      <div class="layui-input-block">
        <input type="text" name="username" required lay-verify="required" placeholder="请输入标用户名" autocomplete="off"
          class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">密码</label>
      <div class="layui-input-block">
        <input type="text" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off"
          class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">验证码</label>
      <div class="layui-input-block">
        <input type="text" name="code" required lay-verify="required" placeholder="请输入验证码" autocomplete="off"
          class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
     
      <div class="layui-input-block">
          <img src="/codeImg" id="code"  alt="" style="height:40px;width:100px;">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>

      </div>
    </div>
  </form>

  <script>
    //Demo
    layui.use('form', function () {
      var form = layui.form;

      //提交
      // form.on('submit(formDemo)', function(data){
      //   layer.msg(JSON.stringify(data.field));
      //   return false;
      // });
    });
  </script>
</body>

</html>